home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / System / Sample JGNE⁄cdev 1.2.1 / SharedData.h < prev   
Encoding:
C/C++ Source or Header  |  1994-06-07  |  1.9 KB  |  59 lines  |  [TEXT/KAHL]

  1. /*    SharedData.h
  2.  *
  3.  *    This file contains some defines and data definitions common to both
  4.  *    the extension code and the control panel code.
  5.  */
  6.  
  7.  
  8. /* These are the resource number and resource type of the 'preferences' */
  9. /* resource used to store control panel settings. */
  10.  
  11. #define kCPprefsRsrcType    'pref'    /* the preferences resource type & ID# */
  12. #define kCPprefsRsrcID        -4048
  13.  
  14. /* These are the resource number and type of the resource that stores */
  15. /* the address of the data structure that the control panel needs access to */
  16.  
  17. #define kMemAddrType        'memA'    /* shared memory address resource type & ID# */
  18. #define kMemAddrID            -4048
  19.  
  20.  
  21. // This is preferences structure accessed by the INIT and the cdev.  It is
  22. // stored as a resource to hold control panel settings.
  23.  
  24. typedef struct {
  25.     Boolean        On;            /* Is the extension "on" or "off"? */
  26.     Boolean        ShowIcon;    /* Show icon at startup? */
  27.     short        modifiers;    /* modifier keys */
  28. } CPprefsStruct, *CPprefsPtr, **CPprefsHandle;
  29.  
  30. /* This is the struct used to access the shared memory address resource */
  31.  
  32. typedef struct {
  33.     long    theAddr;
  34. } **memAddrHdl;
  35.  
  36. typedef struct {
  37.  
  38.     /* Variables used by the Control Panel */
  39.     /* These are declared here because the control panel needs to */
  40.     /* share the values with the INIT and/or task code. */
  41.     
  42.     Boolean            CPon;            /* is the control panel switched on or off? */
  43.     short            CPmodifiers;    /* modifier keys set in control panel */
  44.     CPprefsHandle    CPprefsRsrc;    /* holds the prefs rsrc when loaded */
  45.     DialogPtr        CPdlg;            /* holds the CP dialog ptr */
  46.     
  47.     Boolean        INITrun;        /* was the INIT run at startup? */
  48.     
  49.     long        checkValue;        /* check value set by the extension and */
  50.                                 /* checked by the cdev */
  51.  
  52.     Boolean        taskInstalled;    /* was the task installed? */
  53.  
  54.     Boolean        hasColor;        /* does this machine have color QuickDraw? */
  55.     short        sysVersion;        /* system version:  6, 7, or zero */
  56.  
  57. } myDataStruct, *myDataPtr;
  58.  
  59.